#include <iostream>
using namespace std;
int main()
{
	int a,sum=0;
    cin>>a;
    	for(;a>0;a/=10){
    		sum+=a%10;
		}
    cout<<sum;
    return 0;
}
